Ektron CMS400.Net Reference

>>Conducting eCommerce with Ektron CMS400.NET > Recommendations > Recommendation Server Control

Recommendation Server Control

Prerequisite: Cross sell or upsell products have been assigned to a catalog entry. See Also: eCommerce Recommendations

The Recommendation server control allows you to cross-sell or up-sell products to a site visitor based on another product’s ID. After a user creates a product in the Workarea, he can define a list of other products he wants to associate with the newly-created product. This can be done while viewing a product in the Workarea and selecting the View menu > Cross Sell or Up sell. Then, by adding the Recommendation server control to a Web form that contains a Product server control, the site visitor sees the recommendations when he views the details of the product.

Typically, this control appears on a page along with a “Product server control.” By using this control in conjunction with the Product control, a site visitor can view the details of a product and also receive suggestions on additional purchases. A site visitor can click the title to view the suggested product to view its details.

For example, if your site is selling a hat, mitten and scarf set, you might use this server control to cross-sell winter jackets. You could also use the control to up-sell a more expensive hat, mitten and scarf set, or a set that includes additional items.

For information on adding cross sell and upsell information to a product in the Workarea, see Adding Cross Sell and Upsell Recommendations to a Catalog Entry”.

Setting the RecommendationType property determines whether the Recommendation server control is used for up-selling or cross-selling.

Enabling the Add to Cart Button

Site visitors can add a product to their cart directly from the Recommendation server control by clicking Add to cart next to a product. This link appears below the price and allows them to skip the product’s information page and add the product directly to their cart.

By default, this button appears when the following conditions are met:

The product is buyable. That is, there is a check mark in the Buyable property for a product in the Workarea. See Also: Buyable

The product has an In Stock quantity of at least one.

The TemplateCart property has a cart’s template location defined.

In addition, when a product has an alias path associated with it, you need to do the following:

Make sure the TemplateCart property’s path is relative to the site root. For example:

TemplateCart="Developer/Commerce/CartDemo.aspx"

Add the following to the code behind page. This example is in C#:

protected void Page_Init(object sender, EventArgs e)

{

Utilities.RegisterBaseUrl(this.Page);

}

Recommendation Server Control Properties

The following table explains the properties of the Recommendation control.

Note: The following table only lists Ektron-specific properties. It does not describe native .NET properties such as font, height, width and border style. For documentation of these properties, see Visual Studio help.

Property

Description

Data Type

Authenticated

Indicates if you are logged in to the
CMS Explorer and can use it to browse to Content, Collections, etc. See Also: ”Using CMS Explorer to Browse Your Ektron CMS400.NET Site” on page 21-12

String

CacheInterval

Sets the amount of time the server control’s data is cached. The default is 0 (zero). This is the amount of time, in seconds, a control’s data is cached. For example, if you want to cache the data for five minutes, set the CacheInterval property to 300 (three hundred). See Also: ”Caching with Server Controls” on page 21-42

Double

CustomXml

(Code Behind Only)

Enter a string of XML that you want to make available to the XSLT. This property provides a mechanism to inject custom XML into the generated XML before being processed by the XSLT. The sting is added inside the CustomXml tag as follows:

<root><customXml>custom-xml-inserted-here</customXml></root>

See Also: ”Displaying Custom XML in Ektron’s Server Controls” on page 21-49

String

DefaultProductID

Enter a default product ID that contains either cross sell or up sell products. To make the server control dynamic, enter zero (0) in this property and set the DynamicProductParameter to QueryString parameter used to pass the product’s ID.

Integer

DisplayXslt

Specify an external XSLT file to render the control. By default, the control uses Recommendation.xsl. This file is located in
<SiteRoot>\Workarea\Xslt\Commerce

Warning! If you want to edit this file, it is strongly recommended that you make a copy, change its name and move it outside your site’s Workarea folder. If you make changes to this file and do not move it out of the Workarea folder, this file and the changes will be lost when you upgrade.

String

 

DoInitFill

By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, FIll is automatically called during the Page Render event.

You might do this if you need to set or change a property on the control in codebehind and have it render with your changes shown.

Boolean

DynamicCartParameter

The QueryString parameter name which is used to pass the product ID to the Cart server control. For example, if your QueryString parameter for products is Product, enter that in this property. Then, when site visitors click Add to Cart, this parameter is passed with the product’s ID Web form containing the Cart server control. See Also: Cart Server Control

String

DynamicProductParameter

The QueryString parameter name which is used to pass the product ID to the product details page. For example, if your QueryString parameter for products is ID, enter that in this property. Then, when site visitors click a product’s title, this parameter is passed with the product’s ID to the product details page.

String

Hide

Used to hide the Server Control in design time and runtime.

True = Hide control

False = Show control

Boolean

Language

If the template on which this server control resides includes a language selection control, and you want to let the site visitor select the language, enter zero (0).

Otherwise, click the field, then the ellipsis button () and a popup box appears. Select a language from the list.

This property shows results in design-time (in Visual Studio) and at run-time (in a browser).

Integer

PageSize

Specify the number of items to show per page when a site visitor views recommendations. If the number of items exceeds the quantity defined in this property, the list is paged and the site visitor can use the paging navigation system to move through the list.

Integer

RecommendationType

The type of recommendation to show. Choices are:

CrossSell - used to help sell additional products that a site visitor might be interested in. For example, if you are selling Denim Jackets, you might want to cross sell them pants or shirts.

UpSell - used to sell additional products that improve on the product being purchased. For example, if you are selling 7 megapixel digital cameras, you might want show the site visitor 10 megapixel digital cameras.

See Also: Adding Cross Sell and Upsell Recommendations to a Catalog Entry

Data Type: EkEnumeration.RecommendationType

 

Stylesheet

Specify the location of a style sheet to use for the recommendation. Set the location relative to the site root folder. For example: Workarea\csslib\mytest.css

Leave blank to use the default style sheet.

String

SuppressWrapperTags

Suppresses the output of span/div tags around the control. The default is False.

True - Suppress wrap tags.

False - Allow wrap tags.

Boolean

TemplateCart

The URL to navigate to when the site visitor clicks Add to Cart. This path can be relative or absolute.

When a path is entered, the Add to Cart button appears next to the product and allows a site visitor to add the product directly to their cart. See Also: Enabling the Add to Cart Button and Cart Server Control.

String

TemplateProduct

Specify the URL that contains the Product server control. This allows a site visitor to see the details of the product when the product link is clicked. This path can be relative or absolute.

String


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.